#include <gtest/gtest.h>
#include <iostream>
#include <set>
#include <memory>

typedef std::shared_ptr<int> IntPtr;

struct Compare
{
    using is_transparent = void;

    bool operator() (const IntPtr& a, const IntPtr& b) const
    {
        return *a < *b;
    }

    bool operator() (const IntPtr& a, int b) const
    {
        return *a < b;
    }

    bool operator() (int a, const IntPtr& b) const
    {
        return a < *b;
    }
};

int shared_ptr_shared()
{
    std::set<IntPtr, Compare> s;

    auto x = std::make_shared<int>(3);
    s.insert(x);

    bool found = s.find(3) != s.end();

    std::cout << "result:" << found << "\n";
    return 0;
}

// https://stackoverflow.com/questions/32610446/find-a-value-in-a-set-of-shared-ptr
TEST(shared_ptr_shared_test,test1){
    ASSERT_EQ(0,shared_ptr_shared());
}




